#pragma once

#include <iostream>
#include <string>
#include <fstream>
#include <sstream>
using namespace std;

struct CFG_J
{
    string key;// Index
    string value;//ֵ Index's V
    CFG_J *next;// Next node
};
class Config
{
private:
    string file_name;// the name or full path of open file
    CFG_J * head;// head node
    int cfg_line;// total data lines count
    int createHead();
    int freeJoin();
    int inputFile();
    int joinHead(string key, string value);
public:
    Config(string file_name);
    ~Config();
    int getLines();
    int setCFG(string key, string value);
    string getCFG(string key);
    int getCFG();
    void printCfg();
};
